<template>
  <div class="child">
    <h3>我是child组件(子)</h3>
    {{ sum }}
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  name: "child",
  async setup() {
    let sum = ref(0);
    // return { sum }
    let p = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({ sum });
      }, 1000);
      console.log(reject)
    });
    return await p
  },
};
</script>

<style>
.child {
  background-color: skyblue;
  padding: 10px;
}
</style>